package cn.itsource.controller.manager;

import cn.dev33.satoken.annotation.SaIgnore;
import cn.itsource.api.LoginRemoteApi;
import cn.itsource.mapper.LoginMapper;
import cn.itsource.pojo.domain.Login;
import cn.itsource.result.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program fccar_240420
 * @Description
 * @Date 2024/09/04 16:12
 * @Version 1.0
 */
@RestController
public class LoginRemoteImpl implements LoginRemoteApi {
    @Autowired
    private LoginMapper loginMapper;
    @Override
    // @Transactional//作用域 只能作用在自己的这个项目里面
    @SaIgnore
    public JSONResult create(Login login) {
        int i = 1/0;
        int insert = loginMapper.insert(login);
        if(insert == 1){
            return JSONResult.success();
        }
        return JSONResult.error("保存失败");
    }
}
